package com.example.healthmanagement.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.example.healthmanagement.R;
import com.example.healthmanagement.databinding.ActivityManagerBinding;

public class ManagerActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityManagerBinding binding = ActivityManagerBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        //食谱管理
        binding.llDiet.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(ManagerActivity.this, MenuManagerActivity.class));
            }
        });
        //热量管理
        binding.llFoodEnergy.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(ManagerActivity.this, AddFoodEnergyActivity.class).putExtra("isManager", true));
            }
        });
        binding.llPerson.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(ManagerActivity.this, ManagerUserActivity.class));
            }
        });
        binding.llOut.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(ManagerActivity.this, LoginActivity.class));
                finish();
            }
        });
    }

    public void back(View view) {
        finish();
    }
}